package yang.VirtualMachine.chapter9.classStruct.constantPool;

import java.io.IOException;
import java.io.InputStream;

import yang.VirtualMachine.chapter9.ClassUtil;

/**
 * Double
 * u1 tag;u4 high_bytes;	u4 low_bytes;
 * @author xinxin
 */
public class Con_DoubleProcesser implements PoolValue {
	
	private int highValue;
	
	private int lowValue;
	
	private long value;

	@Override
	public void process(InputStream input) throws IOException {
		highValue = (int) ClassUtil.getNumByStream(input, 4);
		lowValue = (int) ClassUtil.getNumByStream(input, 4);
		// TODO Double的值计算
		value = (highValue << 32) + lowValue;
	}

	@Override
	public String getValue() {
		return String.valueOf(value);
	}

}
